<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript"
	src='<c:url value="/resources/js/jquery-ui-1.8.16.custom.min.js"/>'></script>
<link rel="stylesheet"
	href='<c:url value="/resources/css/redmond/jquery-ui-1.8.16.custom.css"/>' />
	
<style>
	.ui-progressbar-value { background-image: url(<c:url value="/resources/css/redmond/images/pbar-ani.gif"/>); }
	</style>
<script type="text/javascript"
	src='<c:url value="/resources/js/jquery.ui.datepicker-zh-CN.js"/>'></script>		
<script type="text/javascript"
	src='<c:url value="/resources/js/configuration/dataSafe.js"/>'></script>

<form id="updateForm" action='<c:url value="/MainMenu/configuration/saveBackupConfig.htm"/>' method="post">
<fieldset>
<legend>数据备份</legend>
<table class="nostyle">
	<tbody>
		<tr><td><label>自动备份间隔(小时):</label></td><td><input type="text" id="hour" name="hour" value="${backupInterval }"><input type="submit" value="确定"></td></tr>
	</tbody>
</table>
<p class="msg info">${message}</p>
<c:if test="${isRunningBackup }">
	<p class="msg info">想要停止备份吗？ <a href="#" onclick="stopBackup()">停止备份</a></p>
</c:if>
</fieldset>
</form>

<fieldset>
<legend>数据恢复</legend>
<c:if test="${empty backupFileList }">
	<p>暂无备份</p>
</c:if>
<c:if test="${!empty backupFileList }">
<table>
<tbody>
	<tr>
		<th>
			备份时间
		</th>
		<th>
			操作
		</th>
	</tr>
	
	<c:forEach items="${backupFileList }" var="file">
		<tr>
			<td>
				${file.backupDate }
			</td>
			<td>
				<a href="#" onclick="restore('${file.fileName}')">还原</a>
			</td>
		</tr>
	</c:forEach>
</tbody>
</table>
</c:if>
</fieldset>

<fieldset>
<legend>删除过期备份数据</legend>
<table class="nostyle">
	<tbody>
		<tr><td><label>删除日期</label></td><td><input type="text" id="lastDate">前的所有备份。<input type="button" id="deleteBackupFile" value="确定"></td></tr>
	</tbody>
</table>
<p class="msg info" id="deleteMessage">删除的文件不包括你选择的日期</p>
</fieldset>

<fieldset>
<legend>已返利完成会员转存</legend>
<table class="nostyle">
	<tbody>
		<tr><td><label>转存截止日期:</label></td><td><input type="text" id="datetime" name="dateTime"><input type="button" id="backUpOldMember" value="确定"></td></tr>
	</tbody>
</table>
	<p class="msg info" id="oldMemberOperateMessage">如有需要可进行转存，用于将已经返利完成的会员，按照日期，转存于另一张备份表</p>
</fieldset>

<c:if test="${isRunningBackup }">
	<form id="stopBackupForm" action='<c:url value="/MainMenu/configuration/stopBackup.htm"/>' method="post">
	</form>
</c:if>
<form id="restoreForm" action='<c:url value="/MainMenu/configuration/restore.htm"/>' method="post">
	<input type="hidden" id="fileName" name="fileName" value=""/>
</form>
<div id="progressbar" style="">
</div>
